﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace JingQiao.Ads.Infrastructure.Data.NH.Repository
{
    using Domain.Model;
    using Domain.Model.DomainObject;
    using Domain.Model.Repository;
 
    public class DestPositionAdRepository : BaseRepository<IDestPositionAd>, IDestPositionAdRepository
    {
        public DestPositionAdRepository(IContext context)
            : base(context)
        {
        }

        public IQueryable<IDestPositionAd> FindByAdvertisementId(int advertisementId)
        {
            return null;
        }

        public PagedResult<IDestPositionAd> Search(string name, int destinationId, int pageSize, int pageIndex)
        {
            return null;
        }

        public PagedResult<IDestPositionAd> SearchByConfig(string name, int configinfoId, int pageSize, int pageIndex)
        {
            return null;
        }

        public int CountByName(string name)
        {
            return 0;
        }

        public IQueryable<IDestPositionAd> FindByAdIdAndPositionIdAndDestId(int adId, int positionId, int destId)
        {
            return null;
        }

        public IQueryable<IDestPositionAd> FindAdByDestIdAndPositionId(int destinationId, int positionId)
        {
            return null;
        }
    }

    public class DestPositionAdComparer : IEqualityComparer<IDestPositionAd>
    {

        #region IEqualityComparer<Destination> 成员

        public bool Equals(IDestPositionAd x, IDestPositionAd y)
        {
            return x.AdvertisementId == y.AdvertisementId;
        }

        #endregion

        #region IEqualityComparer<DestPositionAd> 成员


        public int GetHashCode(IDestPositionAd obj)
        {
            return obj.ToString().GetHashCode();
        }

        #endregion
    }
}
